﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace CentralVacuum.Models
{
    /// <summary>
    /// 日志实体
    ///</summary>
    [SugarTable("AlarmLogs")] //数据库的表名称
    public class AlarmLogs
    {
        /// <summary>
        /// id 
        ///</summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
        public int id { get; set; }
        /// <summary>
        /// 日期时间 
        ///</summary>
        [SugarColumn(ColumnName = "dateLog")]
        public DateTime dateLog { get; set; }
        /// <summary>
        /// 报警消息 
        ///</summary>
        [SugarColumn(ColumnName = "alarmNote")]
        public string alarmNote { get; set; }
        /// <summary>
        /// 设备PN码 
        ///</summary>
        [SugarColumn(ColumnName = "pn")]
        public string pn { get; set; }

        public AlarmLogs()
        {
            dateLog = DateTime.Now;
            alarmNote = "";
            pn = "";
        }

        /// <summary>
        /// 报警日志参数
        /// </summary>
        /// <param name="dateLog">日期</param>
        /// <param name="alarmNote">报警消息</param>
        /// <param name="pn">设备pn码</param>
        public AlarmLogs(string alarmNote, string pn)
        {
            this.dateLog = DateTime.Now;
            this.alarmNote = alarmNote;
            this.pn = pn;
        }
    }
}
